package property.personal.property_mange.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import property.personal.property_mange.dao.EditMapper;
import property.personal.property_mange.dao.PropertyMapper;
import property.personal.property_mange.pojo.Propertyinfo;
import property.personal.property_mange.service.EditService;

@Service
public class EditImpl implements EditService {

    @Autowired
    EditMapper editMapper;

    @Autowired
    PropertyMapper propertyMapper;

    @Override
    public Propertyinfo getedit(Long id) {
        return propertyMapper.selectById(id);
    }

    @Override
    public int editbyid(String name, int code, String director, String telphone, String password, String address, String logo, String id,String indroduce) {
        Propertyinfo propertyinfo=new Propertyinfo();
        propertyinfo.setPropertyname(name);
        propertyinfo.setPropertycode(code);
        propertyinfo.setDirector(director);
        propertyinfo.setTelphone(telphone);
        propertyinfo.setLoginpassword(password);
        propertyinfo.setPropertyaddress(address);
        propertyinfo.setPropertyindroduce(indroduce);
        propertyinfo.setPropertylogo(logo);
        propertyinfo.setId(id);
        return editMapper.updateById(propertyinfo);
    }
}
